// 字符串
/**
 * @param {string} pattern
 * @param {string} s
 * @return {boolean}
 */
 var wordPattern = function(pattern, s) {
    let pa=new Map();
    let ss=new Map();
    s=s.split(' ');
    if(pattern.length!=s.length)
    return false;
    for(let [i,word] of s.entries()){
        let ch=pattern[i];
        if(pa.has(word)&&pa.get(word)!=ch||ss.has(ch)&&ss.get(ch)!==word)
        return false;
    pa.set(word,ch);
    ss.set(ch,word);
    }
    return true;
     
    };